package com.smart.enums;

public enum EcpStateEnum {
    ECP_FLAG_IS_USE("2","已核销"),
    ECP_FLAG_IS_EFFECTIVE("1","未使用"),
    ECP_FLAG_IS_OBSOLETE("0","已作废");

    private String code;
    private String name;
    EcpStateEnum(String code, String name){
        this.code = code;
        this.name = name;
    }

    public static String getName(String code){
        for (EcpStateEnum obj : EcpStateEnum.values()) {
            if(obj.getCode().equals(code)){
                return obj.getName();
            }
        }
        return "";
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }
}
